package io.renren.modules.sys.service.impl;

import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;

import org.apache.commons.lang.StringUtils;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.modules.sys.dao.UserOrderLogDao;
import io.renren.modules.sys.entity.UserOrderLogEntity;
import io.renren.modules.sys.service.UserOrderLogService;


@Service("userOrderLogService")
public class UserOrderLogServiceImpl extends ServiceImpl<UserOrderLogDao, UserOrderLogEntity> implements UserOrderLogService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
    	String userId = String.valueOf(params.get("userId"));
    	String type = String.valueOf(params.get("type"));
    	
        Page<UserOrderLogEntity> page = this.selectPage(
                new Query<UserOrderLogEntity>(params).getPage(),
                new EntityWrapper<UserOrderLogEntity>()
                .eq(StringUtils.isNotBlank(userId),"user_id",userId)
                .eq(StringUtils.isNotBlank(type),"type",type)
        );

        return new PageUtils(page);
    }

	@Override
	public int recheckApply(UserOrderLogEntity entity) {
		return baseMapper.recheckApply(entity);
	}

	@Override
	public int recheckAuth(UserOrderLogEntity entity) {
		return baseMapper.recheckAuth(entity);
	}

}
